
Page({
  data: {
	tabs: [
		{
			id: 0,
			value: '商品收藏',
			isActive: true
		},
		{
			id: 1,
			value: '品牌收藏',
			isActive: false
		},
		{
			id: 2,
			value: '店铺收藏',
			isActive: false
		},
		{
			id: 3,
			value: '浏览痕迹',
			isActive: false
		}
	],
	collect:[]
  },
  handleTabsItemChange(e){
	  const index = e.detail
	  let {tabs} = this.data
	  
	  tabs.forEach((item, index2) => {
	  	index2 === index ?
	  	item.isActive = true :
	  	item.isActive = false;
	  })
	  // 赋值
	  this.setData({
	  	tabs
	  })
  },
  onShow(){
	  const  collect = wx.getStorageSync("collect") || []
	  this.setData({
		  collect
	  })
  }
  
})